<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<!DOCTYPE html>
<html lang="en">
<!-- [Head] start -->

<head>
  <script src="/myhouse/static/ueditor/ueditor.config.js" type="text/javascript"></script>
  <script src="/myhouse/static/ueditor/ueditor.all.js" type="text/javascript"></script>
  <script src="/myhouse/static/ueditor/ueditor.config.js" type="text/javascript"></script>
  <script src="/myhouse/static/ueditor/ueditor.all.js" type="text/javascript"></script>
  <script src="/myhouse/static/mediator/js/jquery-3.2.1.min.js" type="text/javascript"></script>
  <title>Typography | Berry Bootstrap 5 Admin Template</title>
  <!-- [Meta] -->
  <meta charset="utf-8" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0, minimal-ui" />
  <meta http-equiv="X-UA-Compatible" content="IE=edge" />
  <meta
          name="description"
          content="Berry is made using Bootstrap 5 design framework. Download the free admin template & use it for your project."
  />
  <meta name="keywords" content="Berry, Dashboard UI Kit, Bootstrap 5, Admin Template, Admin Dashboard, CRM, CMS, Bootstrap Admin Template" />

  <!-- [Favicon] icon -->
  <link rel="icon" href="/myhouse/static/mediator/images/favicon.svg" type="image/x-icon" />
  <!-- [Google Font] Family -->
  <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap" id="main-font-link" />
  <!-- [Tabler Icons] https://tablericons.com -->
  <link rel="stylesheet" href="/myhouse/static/mediator/fonts/tabler-icons.min.css" />
  <!-- [Material Icons] https://fonts.google.com/icons -->
  <link rel="stylesheet" href="/myhouse/static/mediator/fonts/material.css" />
  <!-- [Template CSS Files] -->
  <link rel="stylesheet" href="/myhouse/static/mediator/css/style.css" id="main-style-link" />
  <link rel="stylesheet" href="/myhouse/static/mediator/css/style-preset.css" id="preset-style-link" />

</head>
<!-- [Head] end -->
<!-- [Body] Start -->

<body>
<!-- [ Pre-loader ] start -->
<div class="loader-bg">
  <div class="loader-track">
    <div class="loader-fill"></div>
  </div>
</div>
<!-- [ Pre-loader ] End -->
<!-- [ Header Topbar ] start -->
<jsp:include page="/inc/mediatorTop.jsp"></jsp:include>
<!-- [ Header ] end -->
<!-- [ Sidebar Menu ] start -->
<nav class="pc-sidebar">
  <div class="navbar-wrapper">
    <div class="m-header">
      <a href="index.jsp" class="b-brand">
        <!-- ========   Change your logo from here   ============ -->
        <img src="/myhouse/static/mediator/images/logo-dark.svg" alt="" class="logo logo-lg" />
      </a>
    </div>
    <jsp:include page="/inc/mediatorLeft.jsp"></jsp:include>
  </div>
</nav>
<style type="text/css">
  /*#title{*/
  /*    width: 900px;*/
  /*    height: 400px;*/
  /*}*/
  table{
    font-size: 20px;
  }
</style>
<div class="pc-container">
  <div class="pc-content">
    <!-- [ breadcrumb ] start -->
    <div class="page-header">
      <div class="page-block">
        <div class="row align-items-center">
          <div class="col-md-12">
            <div class="page-header-title">
              <h5 class="m-b-10">删除房屋信息</h5>
            </div>
            <ul class="breadcrumb">
              <li class="breadcrumb-item"><a href="/myhouse/mediator/index">首页</a></li>
              <li class="breadcrumb-item"><a href="javascript: void(0)">管理房屋</a></li>
              <li class="breadcrumb-item" aria-current="page">删除房屋</li>
            </ul>
          </div>
        </div>
      </div>
    </div>
    <div class="row">
      <!-- [ sample-page ] start -->
      <div class="col-sm-12">
        <div class="card">
          <div class="card-header">
            <h5>删除房屋</h5>
          </div>
          <div class="card-body">
            <c:if test="${empty sessionScope.mediator.mediatorName}">
              <div id="mydiv">请先登录</div>
            </c:if>
            <c:if test="${not empty sessionScope.mediator.mediatorName}">
              <form action="/myhouse/mediator/delete" method="get" id="myform" enctype="multipart/form-data">
                <input type="hidden" value="${requestScope.house.id}" name="id">
                <table width="900px" align="center">
                  <tr>
                    <td>城市</td>
                    <td>
                      <div>${requestScope.house.city}</div>
                    </td>

                    <td>出售方式</td>
                    <td>
                          <c:forEach items="${requestScope.sellMannerList}" var="sellManner">
                            <c:if test="${sellManner.id == requestScope.house.mannerId}">
                            <div>${sellManner.sellManner}</div>
                            </c:if>
                          </c:forEach>
                  </tr>
                  <tr>
                    <td>类型</td>
                    <td>
                      <div>${requestScope.house.type}</div>
                    </td>
                    <td>卧室数量</td>
                    <td>
                      <div>${requestScope.house.room}</div>
                    </td>
                  </tr>
                  <tr>
                    <td>价格（¥）</td>
                    <td><div>${requestScope.house.price}</div></td>
                    <td>面积（㎡）</td>
                    <td><div>${requestScope.house.area}</div></td>
                  </tr>
                  <tr>
                    <td colspan="2" style="text-align: left">房屋信息
                      <div id="title" name="houseInfo">${requestScope.house.houseInfo}</div>
                    </td>
                    <td colspan="2" style="text-align: left">房屋展示图片<br>
                      <div><img width="200px" src="/myhouse/static/uploadImages/${requestScope.house.showImg}"></div>
                    </td>
                  </tr>
                </table>
                <div style="text-align: center;margin-top: 30px">
                  <input type="submit" value="确 定" class="btn btn-secondary">
                  <input type="button" value="取 消" class="btn btn-secondary" style="margin-left: 100px" id="qx">
                </div>
                <script type="text/javascript">
                  $(function (){
                    $("#qx").click(function (){
                      location.href = "/myhouse/mediator/showHouse";
                    })
                  })
                </script>

              </form>
            </c:if>

          </div>
        </div>
      </div>
      <!-- [ sample-page ] end -->
    </div>
    <!-- [ Main Content ] end -->
  </div>
</div>
</script>
<script type="text/javascript" src="/myhouse/static/mediator/js/jquery-3.2.1.min.js"></script>

<script type="text/javascript">

  $(function (){
    var ops = {toolbars:[]}
    editor = UE.getEditor("title",ops);
    editor.ready(function (){
      editor.setContent("${requestScope.house.houseInfo}")
    });
  });
</script>

<%--</script>--%>
<!-- Required Js -->
<script src="/myhouse/static/mediator/js/plugins/popper.min.js"></script>
<script src="/myhouse/static/mediator/js/plugins/simplebar.min.js"></script>
<script src="/myhouse/static/mediator/js/plugins/bootstrap.min.js"></script>
<script src="/myhouse/static/mediator/js/config.js"></script>
<script src="/myhouse/static/mediator/js/pcoded.js"></script>

<script src="/myhouse/static/mediator/js/plugins/clipboard.min.js"></script>
<script>
  window.addEventListener('load', (event) => {
    var i_clip = new ClipboardJS('.color-block');
    i_clip.on('success', function (e) {
      var targetElement = e.trigger;
      let icon_badge = document.createElement('span');
      icon_badge.setAttribute('class', 'ic-badge badge bg-success float-end');
      icon_badge.innerHTML = "copied";
      targetElement.append(icon_badge);
      setTimeout(function () {
        targetElement.children[0].remove();
      }, 3000);
    });

    i_clip.on('error', function (e) {
      var targetElement = e.trigger;
      let icon_badge = document.createElement('span');
      icon_badge.setAttribute('class', 'ic-badge badge bg-danger float-end');
      icon_badge.innerHTML = "Error";
      targetElement.append(icon_badge);
      setTimeout(function () {
        targetElement.children[0].remove();
      }, 3000);
    });
  });
</script>
</body>
</html>
<style type="text/css">
  td{
    border: 1px solid black;
    text-align: center;
  }
</style>